package com;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import redis.clients.jedis.Jedis;

public class TestSortedSet {
	public static void main(String[] args) {
		Jedis jedis = new Jedis("n1");
		try {
			hashTest(jedis);
		} catch (Exception e) {
			e.printStackTrace();
		} finally{
			jedis.close();
		}
	}
	private static void hashTest(Jedis jedis) {
		Map<String,Double> map  = new HashMap<String, Double>() {
			private static final long serialVersionUID = -2445831157173510396L; {
				put("name", 0.2);
				put("gender", 0.7);
				put("age", 0.5);
			}};
		jedis.zadd("value4", map);
		
		Set<String> zranges = jedis.zrange("value4", 0, 3);
		zranges.forEach(str -> {
			System.out.println(str);
		});
	}
}
